package structure;

import java.util.ArrayList;

public class stack {
	
	private ArrayList<String> stack;
	
	public stack(){
		
		this.stack= new ArrayList<String>();
		
	}
	
	public void push(String s){
		
		this.stack.add(s);
	}
	
	public String pop(){
		
		if(this.stack.isEmpty())
			return "";
		else
			return this.stack.remove(this.stack.size()-1);
	}
	
	public String topOfTheStack(){
		if(this.stack.isEmpty())
			return "";
		else
			return this.stack.get(this.stack.size()-1);
	}
	
	public void printItAll(){
		
		System.out.println(this.stack);
	}
}
